import request from '@/utils/request'

export function getCategory(query) {
  return request({
    url: '/basicdata/category/',
    method: 'get',
    params: query
  })
}

export function createCategory(data) {
  return request({
    url: '/basicdata/category/',
    method: 'post',
    data
  })
}

export function updateCategory(data, id) {
  return request({
    url: `/basicdata/category/${id}/`,
    method: 'PUT',
    data
  })
}

export function deleteCategory(id) {
  return request({
    url: `/basicdata/category/${id}/`,
    method: 'DELETE'
  })
}
